package redis

import (
	"context"
	"time"
)

const (
	VideoPath         = "video:" //--src
	FilePath          = "file:"  //--src
	ImgPath           = "img:"   //--src
	Music             = "music:"
	UserId            = "user_id:"         //--User ID(唯一主键)
	VideoId           = "video_id:"        //--User ID(唯一主键)
	VideIdToID        = "video_id_toID:"   //VideoId(雪花ID)-->vide ID(主键)
	CommentId         = "comment_id:"      //--video ID(唯一主键)
	VideoInfoLikeOrNo = "video_info_like:" //video ID(唯一主键)
)

func (r Redis) SetString(key, value string, duration time.Duration) error {
	return r.Client.Set(context.Background(), key, value, duration).Err()
}
func (r Redis) GetString(key string) (value string, err error) {
	return r.Client.Get(context.Background(), key).Result()
}
